import * as TYPES from '../common/type';

const initialState = {
    indexRefresh : false,
    orderRefresh : false,
    messageRefresh : false,
    circleRefresh : false
}

export default function refreshReducer(state = initialState, action) {
    switch (action.type) {
        case TYPES.REFRESH_INDEX:
            return {
                indexRefresh : !state.indexRefresh
            }
        case TYPES.REFRESH_ORDER:
            return {
                orderRefresh : !state.orderRefresh
            }
        case TYPES.REFRESH_MESSAGE :
            return {
                messageRefresh : ! state.messageRefresh,
            }
        case TYPES.REFRESH_CIRCLE :
            return {
                circleRefresh : ! state.circleRefresh,
            }
        default:
            return state;
    }
}